<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The parallel\Sync class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.parallel-events-event-type.html">« parallel\Events\Event\Type</a></li>
      <li style="float: right;"><a href="parallel-sync.construct.html">parallel\Sync::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.parallel.html">parallel</a></li>
    <li>The parallel\Sync class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.parallel-sync" class="reference">

 <h1 class="title">The parallel\Sync class</h1>
 

 <div class="partintro"><p class="verinfo">(1.1.0)</p>
  <div class="section">
    <h2 class="title">Low Level Synchronization</h2>
    <p class="para">
     The <span class="classname"><strong class="classname">parallel\Sync</strong></span> class provides access to low level synchronization primitives, mutex, condition variables, and allows the implementation of semaphores.
    </p>

    <p class="para">
     Synchronization for most applications is much better implemented using channels, however, in some cases authors of low level code may find it useful to be able to access
     these lower level mechanisms.
    </p>

  </div>

  <div class="section" id="parallel-sync.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <span class="modifier">class</span> <strong class="classname">parallel\Sync</strong>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constructor */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.construct.html" class="methodname">__construct</a></span>()</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><span class="type scalar">scalar</span></span> <code class="parameter">$value</code></span>)</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Access */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.get.html" class="methodname">get</a></span>(): <span class="type"><span class="type scalar">scalar</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.set.html" class="methodname">set</a></span>(<span class="methodparam"><span class="type"><span class="type scalar">scalar</span></span> <code class="parameter">$value</code></span>)</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Synchronization */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.wait.html" class="methodname">wait</a></span>()</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.notify.html" class="methodname">notify</a></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$all</code><span class="initializer"> = ?</span></span>)</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="parallel-sync.invoke.html" class="methodname">__invoke</a></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$critical</code></span>)</div>


   }</div>


  </div>

 </div>

  






  






  






  






  






  







<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="parallel-sync.construct.html">parallel\Sync::__construct</a> — Construction</li><li><a href="parallel-sync.get.html">parallel\Sync::get</a> — Access</li><li><a href="parallel-sync.set.html">parallel\Sync::set</a> — Access</li><li><a href="parallel-sync.wait.html">parallel\Sync::wait</a> — Synchronization</li><li><a href="parallel-sync.notify.html">parallel\Sync::notify</a> — Synchronization</li><li><a href="parallel-sync.invoke.html">parallel\Sync::__invoke</a> — Synchronization</li></ul>
</div>
</div></div></body></html>